package com.application.screen;
/** ============================================================================= **/

import com.application.utils.Constant;
import com.example.sispakmobile.R;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.text.TextUtils.TruncateAt;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;

public class WelcomeScreen extends Activity{
/** ============================================================================= **/
	public void onCreate(Bundle savedInstanceState){
		/* ======================================================================= */
		super.onCreate(savedInstanceState);
		setContentView(R.layout.welcome_screen);
		
		Button btnContent				= (Button) findViewById(R.id.ibContent);
		Button btnHelp					= (Button) findViewById(R.id.ibHelp);
		Button btnAbout					= (Button) findViewById(R.id.ibAboutt);
		Button btnKamus					= (Button) findViewById(R.id.ibKamus);
		Constant constant				= new Constant();
		
		/** 
		 * Set Ticker */		
		TextView ticker					= (TextView) findViewById(R.id.welText);
		ticker.setEllipsize(TruncateAt.MARQUEE);
		ticker.setText(constant.getTicker());
		ticker.setSelected(true);
		
		/* ======================================================================= */		
		btnContent.setOnClickListener(new OnClickListener() {			
			public void onClick(View v) {
				// TODO Auto-generated method stub
				Intent loginScreen		= new Intent(WelcomeScreen.this, LoginScreen.class);
				
				/** 
				 * Send Parameter */
				Bundle bundle 			= new Bundle();
				bundle.putString("nama", "Randhika");
				
				loginScreen.putExtras(bundle);
	            startActivityForResult(loginScreen, 0);
			}
		});
		/* ======================================================================= */		
		btnKamus.setOnClickListener(new OnClickListener() {			
			public void onClick(View v) {
				// TODO Auto-generated method stub
				Intent kamusScreen		= new Intent(WelcomeScreen.this, KamusScreen.class);
				
				/** 
				 * Send Parameter */
				Bundle bundle 			= new Bundle();
				bundle.putString("nama", "Randhika");
				
				kamusScreen.putExtras(bundle);
	            startActivityForResult(kamusScreen, 0);
			}
		});
		/* ======================================================================= */			
		btnHelp.setOnClickListener(new OnClickListener() {			
			public void onClick(View v) {
				// TODO Auto-generated method stub
				Intent helpScreen		= new Intent(WelcomeScreen.this, HelpScreen.class);
				
				/** 
				 * Send Parameter */
				Bundle bundle 			= new Bundle();
				bundle.putString("nama", "Randhika");
				
				helpScreen.putExtras(bundle);
	            startActivityForResult(helpScreen, 0);
			}
		});
		/* ======================================================================= */			
		btnAbout.setOnClickListener(new OnClickListener() {			
			public void onClick(View v) {
				// TODO Auto-generated method stub
				Intent aboutScreen		= new Intent(WelcomeScreen.this, AboutScreen.class);
				
				/** 
				 * Send Parameter */
				Bundle bundle 			= new Bundle();
				bundle.putString("nama", "Randhika");
				
				aboutScreen.putExtras(bundle);
	            startActivityForResult(aboutScreen, 0);
			}
		});
	}
	/** ========================================================================= **/
}
/** ============================================================================= **/
